package com.raquel.greet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class SignUp
 * Shows entered login data
 * @author raquel_valenzuela
 */
@WebServlet("/SignUp")
public class SignUp extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public SignUp() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter output=response.getWriter();
		
		String login= request.getParameter("login");
		String password= request.getParameter("password");
		String description= request.getParameter("descriptopn");
		String weapons[]= request.getParameterValues("weapons");
		String artifacts[]= request.getParameterValues("artifacts");
		
		output.write("Login is: "+ login + "<br/>");
		output.write("Password is: "+ password +"<br/>");
		output.write("Description: "+ description +"<br/>");
		
		for (int i=0; i<weapons.length; i++){
			output.write(i+".-"+ weapons[i]+"<br/>");
		}
		
		for (int i=0; i<artifacts.length; i++){
			output.write(i+".-"+ artifacts[i]+"<br/>");
		}
		
	}

}
